/**
 * 
 */
package com.geekteam.masterenglish.ui.fragment;

import android.app.Activity;
import android.support.v4.app.Fragment;

import com.actionbarsherlock.app.SherlockFragment;
import com.geekteam.masterenglish.ui.MainActivity;

/**
 * @author MTROL
 *
 */
public class BaseFragment extends SherlockFragment{

	protected MainActivity mActivity;
	
	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if(activity instanceof MainActivity){
			mActivity = (MainActivity) activity;
		}
	}
	
	protected void switchFragment(Fragment fragment){
		if(mActivity!=null){
			mActivity.switchFragment(fragment);
		}
	}
}
